package com.feri.rbacsys.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.RandomStringUtils;

import java.io.Serializable;
import java.util.Date;

/**
 * @TableName t_returnorder
 */
@TableName(value = "t_returnorder")
@Data
@NoArgsConstructor
public class Returnorder implements Serializable {
    /**
     * 代购退货单id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 采购单id
     */
    private Integer productId;

    /**
     * 退货单编号
     */
    private String returnCode;

    /**
     * 退货数量
     */
    private Integer returnStock;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 制单人
     */
    private String operator;

    /**
     * 审核状态，默认为0，0为未审核，1为审核
     */
    private Integer flag;

    public Returnorder(Integer productId, Integer returnStock, String operator) {
        this.productId = productId;
        this.returnStock = returnStock;
        this.operator = operator;
        this.createTime = new Date();
        this.returnCode = RandomStringUtils.randomAlphabetic(5);
    }
}